#include <stdio.h>

#include "uart.h"
#include "timer.h"
#include "intrinsics.h"

#define DATA_TX_SIZE  (10)
#define DATA_RX_SIZE  (10)

char datosRx[DATA_RX_SIZE];
char datosTx[] = "hola como estas?";
unsigned char flagRx;

int main() {

#define LED_ON
#ifdef LED_ON
  DDRB |= (1<<DDB0);
  PORTB = (1<<PORTB0);
#endif
 
  UartInit(12);
//  TimerInit();
  __enable_interrupt();  
  UartTxString(datosTx);
  while(1){
    if (flagRx){
      flagRx = 0;
      UartRxString(datosRx);
      switch (datosRx[0]){
      case 'R':
        UartTxString("leo tiempo");
        break; 
      case 'W':
      default:
        break;
      }//end-switch
    }//end-if
  }//end-while
}//end-main